package com.bwie.bwedu.model.impl;

import android.util.Log;

import com.android.volley.Response;
import com.android.volley.VolleyError;
import com.bwie.bwedu.bean.Student;
import com.bwie.bwedu.bean.response.InfoStudentResponse;
import com.bwie.bwedu.bean.response.MainInfoResponse;
import com.bwie.bwedu.model.TrackInfoModel;
import com.bwie.bwedu.utils.ASimpleCacheUtils;
import com.bwie.bwedu.utils.LogUtils;
import com.bwie.bwedu.volley.RequestAPI;

/**
 * Created by Administrator on 2016/7/23.
 */
public class TrackInfoModelImpl implements TrackInfoModel {
    @Override
    public void track(final String id, final TrackinfoListener listener) {
        RequestAPI.getHistort(id, new Response.Listener<InfoStudentResponse>() {

            @Override
            public void onResponse(InfoStudentResponse infoStudentResponse) {
                if (infoStudentResponse.ok==true){
                    listener.onTrackinfoSuccess(infoStudentResponse.list);
                }else{
                    listener.onTrackinfoFail(infoStudentResponse.msg);
                }

            }


        }, new Response.ErrorListener() {
            @Override
            public void onErrorResponse(VolleyError volleyError) {
                listener.onTrackinfoFail(volleyError.toString());
            }
        });
    }
}
